<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path=request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>留言列表</title>
<script src="<%=path%>/js/jquery.js" type="text/javascript"></script>
<script src="<%=path%>/js/albumdelete.js" type="text/javascript"></script>
<link type="text/css" rel="stylesheet" href="<%=path%>/css/list.css"/>

</head>
<body>
<h3>留言列表</h3>

<form action="<%=path%>/acomment/commentlist.dch" method="post" name="pageForm">
  	查询关键字:<input type="text" name="keyword" value="${keyword}"/><input type="button" value="查询" onclick="javascrip:pageForm.submit();"/>
  			 
  	<input type="button" value="上一页" onclick="javascrip:currentPage.value='${currentPage-1}';pageForm.submit();" ${result.page.hasPrePage?'':'disabled'}/>
  	<input type="button" value="下一页" onclick="javascrip:currentPage.value='${currentPage+1}';pageForm.submit();" ${result.page.hasNextPage?'':'disabled'}/>
  	<input type="hidden" name="currentPage" value="1"/>
  	转到:<input type="text" name="toPage" value=""/><input type="button" size="2" value="跳转" onclick="javascrip:currentPage.value=toPage.value;pageForm.submit();"/>
</form>
<br/>
共${result.page.totalRecords}条记录，分${result.page.totalPage}页，当前第${result.page.currentPage}页
<table class="datalist" id="member">
	<tr>
		<th scope="col">ID</th>
		<th scope="col">用户名</th>
		<th scope="col">留言</th>
        <th scope="col">留言者IP</th>
        <th scope="col">留言时间</th>
        <th scope="col">留言专辑</th>
        <th scope="col">操作</th>
	</tr>
	<s:iterator value="result.list" id="c">
		<tr id="${c.commentid}">
			<td>${c.commentid}</td>
			<td><span class="info">${fn:substring(c.username,0,15)}<span class="minfo">${c.username}</span></span></td>
			<td>
				<span class="info">留言信息
					<span class="minfo">
						${c.comment}
					</span>
				</span>
			</td>
			<td>${c.userip}</td>
			<td>${c.datetime}</td>
			<td>
				<span class="info">${fn:substring(c.album.albumname,0,15)}
					<span class="minfo">
						${c.album.albumname}
					</span>
				</span>
			</td>
			<td>
				<a href="#" onclick="deletecomment(${c.commentid},${result.page.currentPage})">删除</a>				
			</td>
		</tr>
	</s:iterator>
</table>
</body>
</html>